const app = getApp()

Page({
    data: {
    },
    onLoad() {
        const userInfo = JSON.parse(wx.getStorageSync('userInfo'))
        console.log("userInfo", userInfo);
        this.setData({
            userInfo : userInfo
        })
    },
    onShow() {
      const msg = [
        {
          id: 1,
          sendUserId: 1013,
          sendUserUrl: "https://it00zyq.oss-cn-beijing.aliyuncs.com/1a3306899b294e82ae289b1e843e19a1头像.jpg",
          acceptUserId: 2,
          companyName: "福家政有限公司",
          acceptUserUrl: "https://it00zyq.oss-cn-beijing.aliyuncs.com/2ce9569d774d42e39ab817d534d47eecboy-3.png",
          time: '2023/04/10 14:18:18',
          record: [
            {
              id: 1,
              text: "你好",
              time: '2023/04/10 14:18:18',
            }
          ]
        },
        {
          id: 2,
          sendUserId: 1013,
          sendUserUrl: "https://it00zyq.oss-cn-beijing.aliyuncs.com/1a3306899b294e82ae289b1e843e19a1头像.jpg",
          acceptUserId: 8,
          companyName: "有福之家家政公司",
          acceptUserUrl: "https://it00zyq.oss-cn-beijing.aliyuncs.com/2ce9569d774d42e39ab817d534d47eecboy-3.png",
          time: ''
        },
        {
          id: 3,
          sendUserId: 1013,
          sendUserUrl: "https://it00zyq.oss-cn-beijing.aliyuncs.com/1a3306899b294e82ae289b1e843e19a1头像.jpg",
          acceptUserId: 9,
          companyName: "有家家政公司",
          acceptUserUrl: "https://it00zyq.oss-cn-beijing.aliyuncs.com/2ce9569d774d42e39ab817d534d47eecboy-3.png",
          time: ''
        },
        {
          id: 4,
          sendUserId: 1013,
          sendUserUrl: "https://it00zyq.oss-cn-beijing.aliyuncs.com/1a3306899b294e82ae289b1e843e19a1头像.jpg",
          acceptUserId: 10,
          companyName: "有福家政公司",
          acceptUserUrl: "https://it00zyq.oss-cn-beijing.aliyuncs.com/2ce9569d774d42e39ab817d534d47eecboy-3.png",
          time: ''
        },
        {
          id: 6,
          sendUserId: 1013,
          sendUserUrl: "https://it00zyq.oss-cn-beijing.aliyuncs.com/1a3306899b294e82ae289b1e843e19a1头像.jpg",
          acceptUserId: 1012,
          companyName: "福家政有限公司",
          acceptUserUrl: "https://it00zyq.oss-cn-beijing.aliyuncs.com/2ce9569d774d42e39ab817d534d47eecboy-3.png",
          time: ''
        }
      ];
      this.getTabBar().init();
        const userInfo = JSON.parse(wx.getStorageSync('userInfo'))
        this.setData({
            userInfo : userInfo,
            my_friends : msg
        })
        this.getMyfriend()
    },
    getMyfriend() {
       
    },

    startChat(e) {
        var index = e.currentTarget.dataset.index;
        console.log(this.data.my_friends)
        wx.navigateTo({
          url: '/pages/chat/chat/chat?id=' + this.data.my_friends[index].id
        })
        
    }
})